module.exports = {
	lintOnSave: false,
	productionSourceMap: false,
	chainWebpack: config => {
		config.when(process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development', config => {
			config.set('externals', {
				vue: "Vue",
				"vant": "vant",
				"axios": "axios",
				"vue-router": "VueRouter"
			})
			config.optimization.splitChunks({
				chunks: 'all',
				cacheGroups: {
					vendor: {
						test: /[\\/]node_modules[\\/]/,
						name: 'vendors',
						chunks: 'initial',
					},
				}
			})
			config.optimization.runtimeChunk({
				name: (entrypoint) => `runtime-${entrypoint.name}`
			})
			config.plugin('webpack-bundle-analyzer').use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
		})
	},
	css: {
		extract: false
	}
}